Fixing Warnings

Lots of small changes to silence the chorus of compiler warnings...