Deep copying of the errors object in debug mode