Fix for bug #2161