Fixed situation when it's not possible to open the port.