Several improvements to syntax highlighting