Fix ugly const-casting required by EngineObject API.