Bug fixes in graph