Changed to pure-reentrant parser, touched a lot of code