Added ground detection.