Fixes #2957
Fixes #3052