Fixes a bug in the HasOne association where serializing twice in a row causes
an exception.