Remove waitFlush param, fix bad expression in query param, adjust tests

As a follow-up to a previous pull request, I removed one fix ("dont quote quoted strings") since I didn't consider it of poor quality. 
The removal of the waitFlush parameter is again included in the pull request, this time I fixed the corresponding test as well.
Another fix I included again is the removal of a duplicate dollar sign in a query parameter.