Fix compile errors -Wunused-but-set-variable