fixes and template failsafe