Gesture detector fix

Fix a problem with the layout of the gesture detector.