Fixed bugs and enhanced the allowed tags

template and folder are reserved tags