Polish changes from PR #3678

... and make it run on 5.2.
1 file changed