Ensuring variables re-declared within lambdas are not replaced