Fix code example syntax error and correct spelling mistakes