You are leaking entities like this, use EntityRef.NULL for a null entity.