Handle correctly null associations

null belongs_to associations are now serialized as nil instead
of raise an error during serialization.