fix undefined index templateEngine, update CodeMirror and fix highlighting active line