fixed bug #6 reported by Bob.