Fixing warnings revealed by gcc release build

Fixed set-but-not-used warnings.

Reviewer: gribozavr