Fix to direct sum in kminvalues and bugfix in kminvalues.union