Fix daemon destruction