fix some bugs Signed-off-by: hurricane618 <hurricane618@hotmail.com> (cherry picked from commit d224ac9cae6c745068bb7d3cef32c1d1d14d41b7)