Fix existence bug in location template