patch from Jan Rejlek <jr@apex-lib.cz> to fix Bug 677692