Some fixes on core