Define FD_COPY if not available
Cleanup code