Fix SOAP-2049 and SOAP-2107

https://smartbearsweden.atlassian.net/browse/SOAP-2049