Fix bug 2865