Fixed leaks in graph