Fixed issues with highlighting functions