Fixed missing endfor issue.