Fixes -Wshadow and -Wsign-conversion compiler warnings.