Applying patch from Bug #19045 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=19045&group_id=10467)