Fix bug where preferences changes are not applied