Add trailing comma and remove trailing whitespace.