Fix bugs in settings