Fix for bug #2965