made ValidatorSet.Hash deterministic; fix off-by-1 bugs