Fix oddly formed conditional in rest interface query parsing
fixed some tautological-compare and unused variable warnings