Fix bug #1018