DO NOT MERGE fixes #6381 - patch for downstream