Clean up resource leaks