Add some more consistent reporting of errors in schema files.

This should fix #24.