More refactoring, minor bugfixes

@dwightguth review?
I actually don't think you need this extra step anymore in the latest version of K. Try it and see.