Fix bug reported by Sean.