More improvements to complexity calculations.