Issue2540

Fixes #2540