Fixed a minor issue regarding mouse events