Fix indexing of dynamically added has-many fieldsets

Fixes #2655.