Fix iterables.extent() swapping min and max. Add tests.