Fixed bug in mouse events.