Added solution for rare case...

...of header's end being inbetween two chunks, thanks to @gamax92 for the help