PortalKit: fix things in build and test