Fix bug in init.js
Fix NPE