Fixed horizontal portals in the new system. Code cleanup.