Some fixes in core