fixed bug in checking out_fh or err_fh even if they were undef