Merge pull request #1 from uaf/master

Some bugfixes
Previous bugfix only compiled in gcc, not in MSVC
Merge pull request #2 from WimPessemier/master

Bugfix for WriteRequestTarget (fixes also Client::write())