core: ko-related bug fix w/ unit test improvements