Adding regression test and fixing some inconsistencies in krun.