Fix bugs

1. refine_hypergraph function
2. realize HMM may initialize a new start after deadend
delete useless