Now properly handles orientation changes.