Bug Fixes to core