More generic cleanup.