Fixed bugs around swipe.