Adds check for empty templates
Adds error-page compatibility
Updates exmaple