Fix bug #1087