Further fixes and template changes