Fix for bug #2505