Some fixes in the core