Fixes the problem introduced in 51327911f2 and turns it into a feature that should fix #2477
51327911f2