Fix unused-but-set-variable warnings