Controller and template fixes