kbmira bug fix & factor handling