Fix issue with groups parsing

Also allow the collection URL to be dynamic.