Add exception handling, fix typo.