Fixed merge_bins function (for brp style bins).