Fixed bug in core