Minor refactoring
Simplify check-function protocol
Minor improvements to error formatting
Remove unnecessary PEP references