fixed some bugs on counting for mkn