Applying changes in 2837af0 to 2.1 branch