Restore behaviour from commit 36ff232cf that was incorrectly removed