Fixed a bounds check error in fd.