fix bugs and support for non-cluster
Merge pull request #89 from michaelnsj/cluster

Merged.