fix typos and enhance exception message