Fix exception raising