fix a bug with trailing commas and boolean values