Fixed JS error caused when settings were not defined