Fixed declaration shadows a local variable warnings/compile errors