Cleanup and fix heisenbugger.