Fixed compiler warnings (local variable shadowing).