Make UUID, fix memory leaks