Fixed copying variables