Fixing two bugs in WS where calling queryString in SignatureCalculator would throw a NullPointerException. Fixes #2336

* Added a test for these cases.