Patch sent by Vitaly Kuznetsov to handle issue he found.