c6ea910 backport missing pieces

Authored and Committed by caolanm a year ago
    backport missing pieces