Fix type errors in tests

Our tests were passing strings instead of buffers in several places, and with
prepared statements those now emit warnings. Fix them.