Typos and minor for loop correction