Minor fixes and add template attribute
merge