Orientation bug fixes

This is a fix to the issue I raised regarding orientation.