Go into Options > Connect > Servers > Undernet > select the server you wish to edit, click Edit.
Make sure the server port is 6667 and not +6697 or blank or anything else.
Go through and edit all the servers within the Undernet group.
The Default Port option is under Options > Connect > Options, and that should be set to +6697 for your general security.
If manually specifying 6667 for hand-typed servers that don't support SSL is too tedious, then change it to 6667.
As long as the server port is correctly asserted in the Edit Servers dialog for each and every server, you should have no problems.