buf fix for keys == null