bugfixes related to sparse histogram