Fix master cleanup for zookeeper mode
Merge pull request #139 from GraceH/mastercleanup

Fix master cleanup for zookeeper mode