Fix #25 reported by ljlin.