Some fixes to the core.