Fix issues in core.js.
Merge branch 'master' into production