Error messages for application

The commit messages are a bit dirty, but I tried to clean all this up with Soon Ho's good advice. The tests for type-checking do not all pass, but it seems this was the case before the changes. Can someone explain this to me?