Avoid writing "0" as port id when the data came back incomplete from the snmp poll, and when the existing data in the DB already contains a port. Keep the existing port id instead.