Fix debugger closing