Fixed some bugs in dit parsing.