More fd==-1 checks