Fixed template extension bug, .length null bug on ifmatches