merge from Patrics branch of 1.8