Find constants using substitution (#321)