Fix identification of inner loops

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