Warning cleanup

Lots of warning clean ups. I've tried to group change types together as possible. I've also tried to make them simple and small.

Some review will be needed but I don't expect a huge amount. the larger blocks will need more attention of course.