Fix for #2024

This PR should fix #2024.

Replaces #2171.
Please remove - I think it is verbose enough.