Fixing up some of the warnings. No fixes of deprecation warnings - casts, explicit braces etc only