Fix entity registration throwing an error