fix for kmax value
(#248)