Change scope of lastexitcode reference