Small corrections that fix the loop