Robustness fixes for the parser