Remove incorrect assertion.
Improve error message.

Previously the parser always printed out an error message followed
by "Invalid file type" even if the file type is correct.