Fix entity issues