Fixed bugs with screen rotation.