Fixes #2986.