Fix for trailing commas in some situations