diff --git a/buspirate_spi.c b/buspirate_spi.c
index 8e649d8..a488fc3 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -39,7 +39,8 @@
 {
 	/* 115200bps, 8 databits, no parity, 1 stopbit */
 	sp_fd = sp_openserport(dev, 115200);
-	/* FIXME: Error checking */
+ 	if (sp_fd < 0)
+		return 1;
 	return 0;
 }
 #else
diff --git a/internal.c b/internal.c
index bf1ca8c..3ecc348 100644
--- a/internal.c
+++ b/internal.c
@@ -299,7 +299,7 @@
 			msg_perr("Proceeding anyway because user forced us to.\n");
 		} else {
 			msg_perr("Aborting.\n");
-			exit(1);
+			return 1;
 		}
 	}
 
diff --git a/pony_spi.c b/pony_spi.c
index b5dfc2f..6ce467e 100644
--- a/pony_spi.c
+++ b/pony_spi.c
@@ -99,6 +99,10 @@
 
 	if (arg && strlen(arg)) {
 		sp_fd = sp_openserport( arg, 9600 );
+		if (sp_fd < 0) {
+			free(arg);
+			return 1;
+		}
 		have_device++;
 	}
 	free(arg);
diff --git a/serial.c b/serial.c
index 0a56568..7443a3c 100644
--- a/serial.c
+++ b/serial.c
@@ -113,8 +113,10 @@
 	    (tolower((unsigned char)dev[1]) == 'o') &&
 	    (tolower((unsigned char)dev[2]) == 'm')) {
 		dev2 = malloc(strlen(dev) + 5);
-		if (!dev2)
-			sp_die("Error: Out of memory");
+		if (!dev2) {
+			msg_perr("Error: Out of memory: %s\n", strerror(errno));
+			return -1;
+		}
 		strcpy(dev2, "\\\\.\\");
 		strcpy(dev2 + 4, dev);
 	}
@@ -123,11 +125,13 @@
 	if (dev2 != dev)
 		free(dev2);
 	if (fd == INVALID_HANDLE_VALUE) {
-		sp_die("Error: cannot open serial port");
+		msg_perr("Error: cannot open serial port: %s\n", strerror(errno));
+		return -1;
 	}
 	DCB dcb;
 	if (!GetCommState(fd, &dcb)) {
-		sp_die("Error: Could not fetch serial port configuration");
+		msg_perr("Error: Could not fetch serial port configuration: %s\n", strerror(errno));
+		return -1;
 	}
 	switch (baud) {
 		case 9600: dcb.BaudRate = CBR_9600; break;
@@ -135,29 +139,32 @@
 		case 38400: dcb.BaudRate = CBR_38400; break;
 		case 57600: dcb.BaudRate = CBR_57600; break;
 		case 115200: dcb.BaudRate = CBR_115200; break;
-		default: sp_die("Error: Could not set baud rate");
+		default: msg_perr("Error: Could not set baud rate: %s\n", strerror(errno));
+			 return -1;
 	}
 	dcb.ByteSize = 8;
 	dcb.Parity = NOPARITY;
 	dcb.StopBits = ONESTOPBIT;
 	if (!SetCommState(fd, &dcb)) {
-		sp_die("Error: Could not change serial port configuration");
+		msg_perr("Error: Could not change serial port configuration: %s\n", strerror(errno));
+		return -1;
 	}
 	return fd;
 #else
 	struct termios options;
 	int fd, i;
 	fd = open(dev, O_RDWR | O_NOCTTY | O_NDELAY);
-	if (fd < 0)
-		sp_die("Error: cannot open serial port");
+	if (fd < 0) {
+		msg_perr("Error: cannot open serial port: %s\n", strerror(errno));
+		return -1;
+	}
 	fcntl(fd, F_SETFL, 0);
 	tcgetattr(fd, &options);
 	for (i = 0;; i++) {
 		if (sp_baudtable[i].baud == 0) {
 			close(fd);
-			msg_perr("Error: cannot configure for baudrate %d\n",
-				 baud);
-			exit(1);
+			msg_perr("Error: cannot configure for baudrate %d\n", baud);
+			return -1;
 		}
 		if (sp_baudtable[i].baud == baud) {
 			cfsetispeed(&options, sp_baudtable[i].flag);
diff --git a/serprog.c b/serprog.c
index 90ece9c..3529127 100644
--- a/serprog.c
+++ b/serprog.c
@@ -110,20 +110,25 @@
 	int sock;
 	msg_pdbg(MSGHEADER "IP %s port %d\n", ip, port);
 	sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (sock < 0)
-		sp_die("Error: serprog cannot open socket");
+	if (sock < 0) {
+		msg_perr("Error: serprog cannot open socket: %s\n", strerror(errno));
+		return -1;
+	}
 	hostPtr = gethostbyname(ip);
 	if (NULL == hostPtr) {
 		hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
-		if (NULL == hostPtr)
-			sp_die("Error: cannot resolve");
+		if (NULL == hostPtr) {
+			msg_perr("Error: cannot resolve %s\n", ip);
+			return -1;
+		}
 	}
 	sp.si.sin_family = AF_INET;
 	sp.si.sin_port = htons(port);
 	(void)memcpy(&sp.si.sin_addr, hostPtr->h_addr, hostPtr->h_length);
 	if (connect(sock, &sp.s, sizeof(sp.si)) < 0) {
 		close(sock);
-		sp_die("Error: serprog cannot connect");
+		msg_perr("Error: serprog cannot connect: %s\n", strerror(errno));
+		return -1;
 	}
 	/* We are latency limited, and sometimes do write-write-read    *
 	 * (write-n) - so enable TCP_NODELAY.				*/
@@ -233,17 +238,23 @@
 	unsigned char c;
 	if (sp_automatic_cmdcheck(command))
 		return 1;
-	if (write(sp_fd, &command, 1) != 1)
-		sp_die("Error: cannot write op code");
-	if (write(sp_fd, params, parmlen) != (parmlen))
-		sp_die("Error: cannot write parameters");
-	if (read(sp_fd, &c, 1) != 1)
-		sp_die("Error: cannot read from device");
+	if (write(sp_fd, &command, 1) != 1) {
+		msg_perr("Error: cannot write op code: %s\n", strerror(errno));
+		return 1;
+	}
+	if (write(sp_fd, params, parmlen) != (parmlen)) {
+		msg_perr("Error: cannot write parameters: %s\n", strerror(errno));
+		return 1;
+	}
+	if (read(sp_fd, &c, 1) != 1) {
+		msg_perr("Error: cannot read from device: %s\n", strerror(errno));
+		return 1;
+	}
 	if (c == S_NAK)
 		return 1;
 	if (c != S_ACK) {
-		msg_perr("Error: invalid response 0x%02X from device\n",c);
-		exit(1);
+		msg_perr("Error: invalid response 0x%02X from device\n", c);
+		return 1;
 	}
 	if (retlen) {
 		int rd_bytes = 0;
@@ -251,8 +262,10 @@
 			int r;
 			r = read(sp_fd, retparms + rd_bytes,
 				 retlen - rd_bytes);
-			if (r <= 0)
-				sp_die("Error: cannot read return parameters");
+			if (r <= 0) {
+				msg_perr("Error: cannot read return parameters: %s\n", strerror(errno));
+				return 1;
+			}
 			rd_bytes += r;
 		} while (rd_bytes != retlen);
 	}
@@ -362,6 +375,10 @@
 		}
 		if (strlen(device)) {
 			sp_fd = sp_openserport(device, atoi(baudport));
+			if (sp_fd < 0) {
+				free(device);
+				return 1;
+			}
 			have_device++;
 		}
 	}
@@ -395,6 +412,10 @@
 		}
 		if (strlen(device)) {
 			sp_fd = sp_opensocket(device, atoi(baudport));
+			if (sp_fd < 0) {
+				free(device);
+				return 1;
+			}
 			have_device++;
 		}
 	}
@@ -466,11 +487,12 @@
 				 "bustype is SPI\n");
 			return 1;
 		}
+		if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
+			return 1;
 		/* Success of any of these commands is optional. We don't need
 		   the programmer to tell us its limits, but if it doesn't, we
 		   will assume stuff, so it's in the programmers best interest
 		   to tell us. */
-		sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL);
 		if (!sp_docommand(S_CMD_Q_WRNMAXLEN, 0, NULL, 3, rbuf)) {
 			uint32_t v;
 			v = ((unsigned int)(rbuf[0]) << 0);
@@ -492,7 +514,8 @@
 			msg_pdbg(MSGHEADER "Maximum read-n length is %d\n", v);
 		}
 		bt = serprog_buses_supported;
-		sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL);
+		if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
+			return 1;
 	}
 
 	if (serprog_buses_supported & BUS_NONSPI) {
