Fix endif/endfor