BUG: Fix unused variable warning

See Issue #2986