Fix dialyzer issues and reformat using emacs.