Fixed to_graph,from_graph by using Macros instead.