Memory leaks fixed. Run destructors on exit.