Template locator bug fix