Fixed bug in copying lists