Fix bugs in dependency parser