Backport some changes from develop-frontend.