Added missing fd close()