Changed setmetadate back to setcontext on template.new as it was causing context loss on includes.