clean up a bit of cruft, add assertions for checking that the parser state is correctly being set (its not)