Fix -Wunused-but-set-variable warning