Fix warning
Fix crash on exit