Bugfix in encoding of the bitvectors
Improvements to histogram, unification of functions handling gpu data