Fixed a bug in port_read