Use sprintf instead of double quotes
Improved exception messages