Fix error with the exception factory