Fix a bug reported by Ian