fixed a bug in binned_tabulate