Fix segfault caused by fclose called with NULL.
Add comment on why we set created partition to 1.