Fix minor bugs in zookeeper code