* backport of commit 6d3a7fd9a286b4ff4fc7ff47054c1ba245f6f959 * backport of commit 8868f675fb50b5f9e1e6c303140ae1578a9421b1 --------- Co-authored-by: Chris Thain <chris.m.thain@gmail.com>