Fix JSON for collections.