fixed IP range to subnet conversion in ts_to_subnet()