Fixes #2790

Work in progress