Some small dialyzer progress

There are still tons of dialyzer errors not fixed by this PR, but I figured it was better to merge things early, particularly since the commits are not related to each-other. I'll add some comments if I think there are commits that need extra review by the original author.