Fixed bug in port deletion