Fixed some warnings

This commits remove below warnings.

* warning: assigned but unused variable
* warning: shadowing outer local variable