Moved constants to settings.js. Fixed NPEs