Fix a bunch of -Wunused-but-set-variable warnings.