fix warning
fix windows warnings
fix type signed/unsigned warning
fixed use of uninitialized variable warning