clean up unused variables and fix compiler warnings

Change-Id: I3c3e30d5e27706d59be78ec935e8a095ba4ab0c0