Make sure fd is defined where it should.