Corrected a loop bug for 1.2