Fix entity deletion in inexisting cases