Fixed loop error.