Fix pan gesture recognition