Add unit deletion and improve view destruction.