Integrated upstream changes from Duet Branch