Add Dialyzer checks

Fixes Dialyzer errors and adds Dialyzer checks on Travis (and otherwise).