Small bug fix in core