fix remaining bits computing error