Fixed in master and 5.2 branches.
Jeroen Stiekema, thanks for the test and pointing out where the problem was!