More work on getting templates to work