Fix type error in some exceptions.