fix static highlight bugs

fixes #1681 #1682 
@zefhemel @lennartcl