Add more guards around zlib-dependent code