Fixes to swipe detection