Fine tuned mouse handling

Fixes #1
Fixes #2