cmdlib: Fix assembling in attach
cmdlib: Check template/nodes before attaching