Fixed NPEs in error reporting from Ermine parser
TODO about some commented code that should be uncommented.