Fix typos

Some of the if statements had td::string::npos and not std::string::pos
Missing "}" on line 1265
Missing ";" on line 1242