Fixing a few bugs, e.g., missing rwSet.copy(), misplaced check for empty rwSet, etc.