Fix two compiler warnings and occurrences in code

Fixes for "Suspicious Implicit Conversions" and "Hidden Local Variable" warnings