WYCS: added support for ensuring set length is non-negative.
WYCS: some very minor refactoring.