Fix bug #1311.