Added some basic port checking

atoi() returns 0 if nothing could be done, so checking for that will be
fine for now