Backport GTNPORTAL-2703 and GTNPORTAL-3340