Fixed bug in first set computation