Tweaking cleanup code

Signed-off-by: Joe Buck <jbbuck@gmail.com>