Fixes to embedded template