Fix some dialyzer warnings
Merge pull request #2208 from fishcakez/dialyzer_fixes

[WIP] Fix some dialyzer warnings