Fixed bugs using dialyzer.

Improved logging by adding lager:debug in error stanza creation.
Added type information, fixed errors with binaries.