Fix shadow declaration.
Fix signed/unsigned comparisons.