Improved mouse detection.