Fixed locations bug in templates