Fixing warnings about locals shadowing others of the same name. At least one of these was an actual bug.