Big fix for bug #2739