Fixed some bugs preventing settings from being changed properly.