More patches to loop and content template workflow