Remove semicolons from templates
avoid npe
Avoid logging error for missing resources
Remove unused function
More error checking