Fixed missing ! in conditional, causing an attempt to close STDOUT and STDERR streams