Fixed template import and template unittest