Fix unhandled exception
Fix parser

This fix affects also the auto-spacer and the auto-complete.