Make sure needsmax actually works for replicasets.
Merged pull request #799