Add dialyzer and fix dialyzer warnings