Replaced some ForIn statements