Catch some possible error conditions