Remove unused variables

This fixes compiler warnings about variable shadowing.