Fixed error in sendPkt() and added error checking for ATND in xbmain.cpp