Synced with latest CR. https://codereview.appspot.com/130950043/#ps40001