Fix error handling in parse_option.

This was causing the parser to ignore the rest of the file after an
unknown option.
More fixes to error handling in config parser.