Fixed mistake in indexing cycles.
Added a place to short circuit while searching for cycles by not checking cycles to large to be formed from the current partition.