Fixed some bugs during parsing and translation