Ancient amphibians had mouthful of teeth, research shows