Fix quorum calculation.
Merge branch `rewrite` into `master`.