Improved template exceptions