Fix unmatched returns dialyzer warnings
Merge pull request #2484 from fishcakez/dialyzer_fixes

Fix unmatched returns dialyzer warnings