Troopers in Texas will now ask drivers for their race when they pull them over following calls to improve the accuracy of the state's traffic data, officials say.

The change comes after revelations that troopers were regularly misidentifying minority drivers — mostly Hispanic — as white when they ticketed them. It is meant to ensure the troopers are not engaging in racial profiling.

When stopping motorists, troopers will "inform them that by state law, they're required now to ask for race or ethnicity and record that accurately," Steven McCraw, Texas Department of Public Safety (DPS) director, told NBC affiliate KXAN in Austin.

The move follows a KXAN investigation earlier this month that reviewed more than 16 million traffic records from the past five years that showed discrepancies in who was pulled over and how DPS troopers recorded those stops.

Related: Read KXAN's investigation

While Hispanic drivers were mistaken as white the most frequently, other minorities were also misidentified.

"The stakes of this are pretty high in terms of preventing unlawful or unconstitutional racial profiling."

When Richard Kai-Tzung Chang, who is from Taiwan, got a traffic ticket in Austin last April, the trooper documented him as white on the citation, KXAN reported.

“It's almost incomprehensible that I could be mistaken for a white male because I don't look anything like a white male,” Chang told KXAN.

25 people whose races were misidentified by state troopers. Brian Collister and Joe Ellis / KXAN

Other examples of drivers listed by troopers as white were those with last names such as Garcia, Martinez, Hernandez, Gonzalez and Rodriguez, the station said, pointing out that while a traditionally Hispanic name doesn't necessarily indicate race, nearly 2 million drivers with traditional Hispanic names were listed as white.

Wrongly marking a driver's race is in violation of the Texas Racial Profiling law, passed in 2001, that requires officers to note the race of every driver who receives a written warning or traffic citation or is arrested during a traffic stop to ensure troopers are not targeting particular group.

Ranjana Natarajan, director of the Civil Rights Clinic at the University of Texas School of Law, called the results of KXAN's investigation "a little bit shocking" and said the findings indicated there may not have been adequate training of troopers.

"The collection of racial profiling data in traffic stops is very important to deter police misconduct. It's the only large-scale data that we have, so it's really important that the data be collected properly," she said. "The stakes of this are pretty high in terms of preventing unlawful or unconstitutional racial profiling."

Questions of profiling by Texas state troopers were raised after the controversial death of Sandra Bland, a black woman pulled over by a DPS trooper over the summer. Bland died in a Texas jail three days after her confrontation with the trooper. Her family has filed a wrongful death suit.

Eric Gay / AP, file

McCraw, the DPS director, initially told KXAN after its investigation that a flaw in the computer system used by troopers could be to blame for the rampant misidentifications. DPS Press Secretary Tom Vinger told the station at the time that the "department categorically rejects" assertions that troopers were engaging in racial profiling.

But on Wednesday, called to testify before the state House Committee on County Affairs, McCraw acknowledged there was a problem.

“What we can do better, and we should have been doing better, is collect the data accurately, as it relates to Hispanics. Plain and simple, [we’re] guilty,” McCraw said, according to KXAN. “That should have been done better and we've got an obligation to fix that."

Natarajan, the law professor, said she hoped the change would "add an additional level of protection to ensure the integrity of the data."

"I think it remains to be seen how it will work out in practice and whether it will be implemented properly," she told NBC News.