Casting to game instance always fails when packaging the game

Thanks you so much for this! It was making me crazy.