First attempt at fixing orientation changes.