Close issue #133, fix segfault

Inner loop condition was using the outer loop index.
fix crash when add/edit sub-circuit parameters

Something was going amiss in the change
detection/replacement code.

Instead of working inplace, build a new list,
compare it with the present list, then swap
if different.