Add forward declaration of PARSER, so grammar.tab.h can use it.
Fix two bugs found by clang static analysis.