fetchRelated with refresh = true issue

I encountered an issue with calling fetchRelated with refresh = true. If there's a model with id = 0 in the relation, the 1st fetchRelated request will go to /model/1/, the 2nd fetchRelated request will go to /model/1;1/, etc. I think this is caused by the code taking a reference to relation.idsToFetch, and then modifying that reference (and implicitly relation.idsToFetch).