Added default value handling in bin_1d and a corresponding test