Fix chunk count

When a file only has two chunks, the count was wrong and the header was
missing