[Fix #414] Fix error on quit