Fixed some issues with swipe detection