Fix a regression
Fix a memory corruption bug. Couple more tests.