Here is a better fix for ticket [c62fac40af] suggested by Kees Nuyt.