Remove the last non-legit unused variables and handle parameters in exceptions matching