Make loop variable local
Accept patches with different levels.