Fixes #2870
Fixes #2947