restored fix for bug 927 into latest code