Fixes for orientation bugs