Serialize belongsTo where id===null as null

Fixes 2) in #2280