bug fixes in core