New test and heap corruption fixes.