template bug fixes

still not 100% valid html but it'll get there soon.  at least it looks
like it works.