Clean up memory in main