Fix bug 1001.