Correctly implement the stack copy command