Fixed uniform doegenerator so it handles nested loops