Fix the existence check in Entity.createModule to be order independent.