Added handling for invalid quaternions for orientation data