[#1855] Fix AIOOB exception in WS.getQueryString
[#1855] Add test for WS.getQueryString