fix miscellaneous parsing and lexing errors from the real server