Resolve some conversion warnings
Some small changes that resolve some Wconversion
and -Wsign-conversion
warnings. None of the changes should have effect on the behavior of the code and the program.
The warning reduction counts given in some commits were on my own machine and may not be completely accurate. On Travis there are now 58 warnings less.