Tweaks to Makefiles. Fixes to code to get rid of the compiler warnings.