components are reassigned correctly, including index refs - fixes #406