Error handling in parser, styles, and a bunch of bugfixes