Merge from Rory upstream