Credit to @rexio8 for identifying the issue.
Move code from line 173 to line 255 to ensure the correct protocol is selected..
Bug caused by stream being accessed remotely (http) and subs being based locally.
Change does include some parameter optimisations. (removing when an object and a property of an object are both passed to internal methods)