Fixed bug with copying values