Fix casting for non-loadable entities