Messed up foreach loop.