Fix closing inspector after delete