Template and directive tweaks