Fix bug in settings migration code