Improve some bad hts buffer code.