[Port] Backport of the newest 1.6.2 version to 1.5