BUG: Fixed shadowed variables

Fixed warnings about local variables shadowing member variables.