Patch from Steve Langasek <vorlon@netexpress.net>.