Add proper variable syntax in templates