Move fix from 2.5.12 into the dev branch.