Fix autosync switch function.