Mark unused variables and make some style fixes

It'd be a nice convention to mark the unused variables like this, now that Ruby 2 will issue no warnings for such vars being unused.
Merge pull request #10143 from Agis-/mark_unused_vars

Mark unused variables and make some style fixes