Fixed broken loop bug.