Fix the tests and the code to work correctly when strict_variables = true