fixes to handle proxy switching accounting
Merge pull request #48 from bluecircle/master

Fixes to resolve proxy switching