Backport of user_port fix.