Fix loop parameters handling
For the loop related algorithm only the globals entry was taken into account.
This patch fixes this and modifies the tests to take that into account.
For the loop related algorithm only the globals entry was taken into account.
This patch fixes this and modifies the tests to take that into account.