libgaem updates, testing code, memory leak fix