Fixes #634 and #658

First, only include caps connected with In/Out in expected balance ratio / fill+max numbers.
Second, only include caps connected with In/Out in actual balance operations
Merge pull request #659 from rezonant/rezonant-bugfix634and658

Fixes #634 and #658