Move "set PLINK_PROTOCOL" after "setlocal" to not affect the caller