Fix warnings about sizes and signs, and local variables masking global ones
Flag unused parameter as such