Error checking when taking from an empty set