Fix broken for loop

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>
Finished feature 54899622/invalid-assertion-hack-incorrect.