name local variables for partial collections properly, fixes #1636