Remove a warning "assigned but unused variable" in test
Remove a warning "shadowing outer local variable - r"
Remove a warning "shadowing outer local variable - g" in examples