Add sanity checking for portals.