Fixed bug when changing some settings