fixed various mouse handling issues