Square-ported and round-ported cartridge valves