Changed templates to use hash values instead of ostruct properties.  Als...

...o moved around a few conditionals.