Refactor semantic highlight checks ; fix problems
Merge pull request #576 from edani/semhigh

Refactor semantic highlight checks ; fix a few problems