remove dangling commas in object templates