Fixed warnings

hidden local variables and 64 bit conversion