Fixed issues with screen rotation