SetDefinitionKernel refactoring. Misc fixes.