Fixed error in copying