Correctly detect unbalanced 'end' in syntax highlighting
Update some tests