Fix swipe-to-dismiss functionality

Also clean out some old related test code.