The root cause was an unclean upgrade - this code is fine. This reverts commit 45f216a9c7.
45f216a9c7