Handle COPY termination properly