Fixed slice delete function along with the python-on-exit reset