Added logic to work around broken responses from servers like Office365.com

Fixes issue #115