Fixes -Wshadow and -Wsign-conversion compiler warnings.

Fixes for two minor (trivial) warnings highlighted by our project settings.