Fixed Setting Bug

Fixed save and restore settings.