fix bug in sum_kbn on empty input