Made some changes to the way motion events are dispatched.