Improved fix for bug#9728.