This PR cherry picks e5aa21fd from the release/2.0.x branch (see #1316) onto master.
release/2.0.x
master