Fine tuned mouse handling

Fixes #1, #2