Fixing a segfault with how fclose is defined.