Nasty bug fixes.
Template selection now autoupdating.