diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c
index 2477cf23..082c671d 100644
--- a/src/scpi/scpi.c
+++ b/src/scpi/scpi.c
@@ -628,13 +628,12 @@ SR_PRIV int sr_scpi_get_string(struct sr_scpi_dev_inst *scpi,
 		return SR_ERR;
 	}
 
-	/* Get rid of trailing linefeed if present */
-	if (response->len >= 1 && response->str[response->len - 1] == '\n')
-		g_string_truncate(response, response->len - 1);
-
-	/* Get rid of trailing carriage return if present */
-	if (response->len >= 1 && response->str[response->len - 1] == '\r')
+	/* Get rid of trailing linefeed & carriage return if present */
+	while (response->len >= 1 &&
+	       (response->str[response->len - 1] == '\n' ||
+		response->str[response->len - 1] == '\r')) {
 		g_string_truncate(response, response->len - 1);
+	}
 
 	sr_spew("Got response: '%.70s', length %" G_GSIZE_FORMAT ".",
 		response->str, response->len);
@@ -1114,11 +1113,13 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
 	 * The response to a '*IDN?' is specified by the SCPI spec. It contains
 	 * a comma-separated list containing the manufacturer name, instrument
 	 * model, serial number of the instrument and the firmware version.
+	 *
+	 * Also support instruments omitting serial number field.
 	 */
 	tokens = g_strsplit(response, ",", 0);
 	num_tokens = g_strv_length(tokens);
-	if (num_tokens < 4) {
-		sr_dbg("IDN response not according to spec: %80.s.", response);
+	if (num_tokens < 3) {
+		sr_dbg("IDN response not according to spec: '%s'.", response);
 		g_strfreev(tokens);
 		g_free(response);
 		return SR_ERR_DATA;
@@ -1134,8 +1135,13 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
 		hw_info->manufacturer = g_strstrip(g_strdup(idn_substr + 4));
 
 	hw_info->model = g_strstrip(g_strdup(tokens[1]));
-	hw_info->serial_number = g_strstrip(g_strdup(tokens[2]));
-	hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));
+	if (num_tokens < 4) {
+		hw_info->serial_number = g_strdup("Unknown");
+		hw_info->firmware_version = g_strstrip(g_strdup(tokens[2]));
+	} else {
+		hw_info->serial_number = g_strstrip(g_strdup(tokens[2]));
+		hw_info->firmware_version = g_strstrip(g_strdup(tokens[3]));
+	}
 
 	g_strfreev(tokens);
 
diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c
index 90c01424..9ada595f 100644
--- a/src/scpi/scpi_serial.c
+++ b/src/scpi/scpi_serial.c
@@ -188,7 +188,7 @@ static int scpi_serial_read_data(void *priv, char *buf, int maxlen)
 		return ret;
 
 	if (ret > 0) {
-		if (buf[ret - 1] == '\n') {
+		if (buf[ret - 1] == '\n' || buf[ret - 1] == '\r') {
 			sscpi->got_newline = TRUE;
 			sr_spew("Received terminator");
 		} else {
