Fixes #2931.