Some fixes

Fixes some typos and adds a missing logger in `utils.py`.
the variable `datagrams_to_send` here doesn't exist. I am not sure either, but I guess it can only be `queries_to_send`.