Fixed bug in templating where attributes weren't being passed on properly.