Correctly put exception in context

@stof This should do the job I think.