Handle invalid JSON errors and fix typo.