Corrected issue with template, bug fixes.