Fixed issue of warnings where  is not valid for For loops.