fix various bugs especially  one with unexpected karma update side effect