fix type in exceptions and missing arguments for some of them in the code