Fixed bug reported by Mike Landeck.