Patch from Martin Lambers <marlam@marlam.de>, from 2005-10-08