handle some common error cases
fix typo