Fix error on quit