Fix an OutOfBounds exception when the full template name did not contain a package part.