fix bug in which data is lost when compressing bins not at the end of the slice