Fixed subset generator to work with strings of arbitrary size.