This regression was introduced in commit afc9d00c. This is a partial backport of commit 199863d7 from 10.4.