More fixes for run away memory allocations.