Ansariel contributed a number of small adjustments that should not affect behavior but should help with performace.