More tweaks to highlighting, and a test for dodgy behaviour