Fix orientation code that is applied when persisting the setting