Implement cleanup of command IOs properly