Cleanup leaks and imports