Issue 6176 problems after make the upgrade

Fixed the issue and pushed the code for review, please check it.