Fixed bugs with copying and error messages