Tweeks to error highlighting logic