Fix bug 2987