Fix for #3166.