Fix for bug #2240