Fix error when closing inactive channel