Fix for bug 1005631