Fix non-portable zlib compression/decompression code.

This will make 64bit host work.
Tested on x86_64 arch linux, looking for somebody to test 64bit on
windows and 32bit too for regressions if any.
Fix some uninitialized variables.