Java bindings: fixed bugs in remote value queries, testquery.