Fix identification of inner loops

Fix idiotic bug when trying to identify inner loops in an ast