Fixed rotation and panning/pinch bug reported by @TomQv.