Fix issue with saving complicated indexed objects to disk where improperly indexed top level attributes were not being added properly to the flattened object