Fix restoring state of external entity loader