Clean up resources.