fix warnings reg. set but unused variables

and remove/comment some other unused ones too
Merge pull request #1217 from Jojo-Schmitz/warnings

fix warnings reg. set but unused variables