Orientation bug fixes