Fixed end cleanup