Fix possible infinite loop on construction.