fix hpricot bugs