Fix for bug #2870