Catch specific exception. Fixes #38 (I think).