Added ZOOKEEPER-642 and ZOOKEEPER-1756 patches