Catch exceptions in expectations

Fixes #33.