fixed some errors in KM