Fixed a couple loops