additional unit tests and bugs uncovered while writing them

Adding additional unit tests for the Proxy.  While writing them I ran across several bugs and have fixed them so that the unit tests pass successfully.