fixed bug where number of bins set to non-integer