Fix error in CopyAttributes(), it created some null values.