Fixed sign issue with calculating size of new header metadata.
RewritePartitionPack rewrites partition pack, preserving length length when possible.
Use of RewritePartitionPack to properly rewrite partition packs and avoid length length issues.