bugfix: ensure using the right offset when writing out the extra chunks