fix some little bugs about long length variables