Added a case when a string of arrays ends with a comma