Removes trailing commas in last key values of objects