Fixed a bug in subset