Debugged crashes on exit