Fix exception when killed