Fixed X snapping and added highlight clamping.
Merge commit 'e2ab45c8a9ec4f7e4f0a623d3686c79070c4e4ae' into Dave