Trivial bug fix pointed out by Paul Fox: potentially missing fclose().