diff --git a/src/libknot/packet/query.c b/src/libknot/packet/query.c
index 59211efa0839462041be4c2af3ad2279d41413d9..0e1091eabc5faea5c8b3dda635f8653b3dabb66d 100644
--- a/src/libknot/packet/query.c
+++ b/src/libknot/packet/query.c
@@ -143,8 +143,11 @@ int knot_query_add_rrset_authority(knot_packet_t *query,
 	
 	size_t written = 0;
 	uint16_t rr_count = 0;
-	knot_rrset_to_wire(rrset, startp, &written, query->max_size,
-	                   &rr_count, NULL);
+	int ret = knot_rrset_to_wire(rrset, startp, &written, query->max_size,
+	                             &rr_count, NULL);
+	if (ret != KNOT_EOK) {
+		return ret;
+	}
 	query->size += written;
 	++query->ns_rrsets;
 	++query->header.nscount;
diff --git a/src/libknot/packet/response.c b/src/libknot/packet/response.c
index 91e79d016066b080652fef8387ebcaa8106aea75..b4b23490372bfd53c9b07879565159b88ca1b74f 100644
--- a/src/libknot/packet/response.c
+++ b/src/libknot/packet/response.c
@@ -524,7 +524,6 @@ dbg_response_exec(
 	param.compressed_dnames = &resp->compression;
 	param.wire_pos = 0;
 	uint16_t rr_count = 0;
-	//TODO size
 	int ret = knot_rrset_to_wire(rrset, pos, &size, max_size,
 	                             &rr_count, &param);
 	
@@ -534,7 +533,7 @@ dbg_response_exec(
 		return ret;
 	}
 
-	if (rr_count >= 0) {
+	if (rr_count > 0) {
 		rrsets[(*rrset_count)++] = rrset;
 		resp->size += size;
 		dbg_response_verb("RRset added, size: %zu, RRs: %d, total "