Fix port write for port with a subset of pins