Fix generation of exceptions message