Fix an issue where cleaning a doc would convert empty arrays to empty strings