template tweaks and fixes