Templating fixes

This fixes a couple of problems with the featureinfo templating mechanism.