Fix bug when converting an internal entity prefix to the entity identifier