Fixing unused variable warnings.

Refs #1777.
Merge pull request #2939 from jwpeterson/fixing_warnings

Fixing unused variable warnings.