fixed invalid cast for zlib functions