add tests for bad procedure names
improve an error message
improve checking of procedure input names against used names
cleanup (fix mangled constant names)