Fix #3317

This fixes it for me @mou, can you double check?