Fix for bug #2566