Improve handling of errors when parsing class files