Remove dialyzer warnings

I've divided the modifications into two. This is the general cleanup to remove dialyzer warnings. There is no change to the modules' external interface in these changes.