Fixed some issues with quaternions and orientations