Always call cleanup() on exit