Cleaned up Set<Object> marshling logic