header_merge() fixes and additional test