Fixed garbage collection bug for has one associations