Add tests to check that the FOR variable is defined after the loop