Make sure hdr.size is always set

Otherwise we can end up generating strange CRCs.