Fixes null variable for preferences
Corrected the fragment for onscripter