Fix a massive performance regression, and a crasher bug on exit