Fixed bug in spa.js & core.js