Fix invariant violation

Fixes #321
This is the meat (the rest is whitespace). The key did not change before, even if the reps changed. Now, changing the reps (via investing), will update the html element.