Bugfix to core.js