Fix invalid port error reporting