From wen heping <wenheping2000 () hotmail ! com> Thanks to Yifei Zhan <openbsd () zhan ! science> for testing the patch