Fixed a bug where the last loop variable sometimes was checked against all expected results