The issue had already been fixed in 4.0 as part of the nullability
work. As such, this commit doesn't fix anything. It does, however,
merge forward a test and makes some stylistic changes to the code so
that it's aligned with the same code in 3.5.x and 3.4.x