Fix for #6131.