Fixed a cleanup bug