fix typos in error message and comment