Fix highlighting issues

fixes #2051 and #2044