 	touchend: (event) =>
 		# Only fire if there are no fingers left on the screen
 
-		if Utils.isTouch()
-			return unless (event.touches.length == 0)
-		else
-			return unless (event.touches.length == event.changedTouches.length)
-
-		@em.wrap(window).removeEventListener("touchmove", @touchmove)
-		@em.wrap(window).removeEventListener("touchend", @touchend)
+		if event.touches?
+			if Utils.isTouch()
+				return unless (event.touches.length == 0)
+			else
+				return unless (event.touches.length == event.changedTouches.length)
+
+		@em.wrap(window).removeEventListener(TouchMove, @touchmove)
+		@em.wrap(window).removeEventListener(TouchEnd, @touchend)
 		@em.wrap(window).removeEventListener("webkitmouseforcechanged", @_updateMacForce)
 
 		event = @_getGestureEvent(event)


{DOMEventManager} = require "./DOMEventManager"


Utils.sanitizeRotation = ->
	previous = null


	constructor: ->
		@em = new DOMEventManager()
		@em.wrap(window).addEventListener(TouchStart, @touchstart)

	destroy: ->
		@em.removeAllListeners()
