Added support for ignoring commas at list end as suggested by conroy,
thanks!