improve method signature errors. fixes #5018

also separate error checking code so all checks are done before making changes