Fix flat_copy not copying source_class properly