Made all the type loops more efficient.