Fix recursive scanning