Made some fixes to PanGestureRecognizer