Fixing recursive serialization