Fixed bug submitted by Warren Weckesser.