Merging in changes from mainline.