Add some error handling to the spec parser.