Fixed Graph class to be serialized correctly