Fix bug in getMousePos