Fix a bug in expect().

It would only complain if the wrong exception was thrown, and not if no
exception was thrown.