Make template not have extra commas at the end of lists