Fix del before definition in nested loops with return statements