fixed some bugs of getdepth function and build method of KNPDependecyGraph class.