Fix dialyzer errors

We can also add `make dialyzer` as a part of running tests with `make test`