More template improvements (ref #1120)