Fixed compiler warnings, removed unused variables.

Change-Id: I70d334e5d2420399fab3dc9fc32dd5cbbe0954ac