Apply size-capping on logical representation instead of physical.

- This supercedes the previous commit, which is a wrong fix.
- Also, modify take() test slightly to cover all cases.