Minor mouse-related optimizations