Perform some cleanup.