Cleanin g with template + samll bugs.