Now raises exception if subnet code goes through too many iterations.