Fix entity relations