Fix for bug #2978