Fix bug related to file descriptor.