Fixed loop statements breaking when condition is constant