clean up comments and assert that headers are finished before getting chunk size