Fixed a logic error in the removePorts method.