settings script bug fix and default values