fix warnings due to -Wunused-but-set-variable