fix up a number of deprecated/conversion/shadow warnings