Bug Fixes in core files