Orientation tests and fixes