Minor modifications to handle touchEnd events.