Patches for hstats

> i saw you've made some improvements to hstats.
>
> go ahead and do a pull request and i'll merge them in.

Oh it was so long ago i forgot what I did. So please review patches carefully.