fix some errors for template

fix compiling errors & warnings in templates
modify trivas script to test template too