Fixing unused variable warnings.

Refs #1777.