Enhance replace_fd(...) readability.