Fixed a memory leak and replaced the GUID generator with the UUID class.