Layout and template fixes