FIX: For 3.1 compatibility, replace deprecated control tags with loop tags