Remove unused variables

This fixes warnings with clang and gcc.
Merge pull request #1508 from mstorsjo/remove-unused-variables

Remove unused variables