Fix runtime errors with loading/saving and dynamic reloads in mediacontext