Connection fixes

Fixes for several issues related to connections from the SDK to the Box API.