A better cleanup function.