Merged Max's fixes for the touch-to-zoom and panning on touch devices