issue #5592: fix some bugs