diff --git a/NEWS b/NEWS
index 5dc3bdf45393adae86e0bd765f561c9131084178..f27af15673d130eb64b82a2fcc4cd0d44797c90b 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Bugfixes
 --------
 - fix SIGPIPE crashes
 - tests: work around out-of-space for platforms with larger memory pages
+- lua: fix mistakes in bindings affecting 1.4.0 and 1.5.0 (and 1.99.1-alpha),
+  potentially causing problems in dns64 and workarounds modules
 
 
 Knot Resolver 1.5.0 (2017-11-02)
diff --git a/daemon/lua/kres-gen.lua b/daemon/lua/kres-gen.lua
index 78f4021480095edaa706d60787d543d847751a9e..c5a1a2d747ec5a561a41a74dfdeb2eafde4c50f1 100644
--- a/daemon/lua/kres-gen.lua
+++ b/daemon/lua/kres-gen.lua
@@ -49,6 +49,7 @@ struct knot_pkt {
 	knot_rrinfo_t *rr_info;
 	knot_rrset_t *rr;
 	knot_mm_t mm;
+	knot_compr_t compr;
 };
 typedef struct knot_pkt knot_pkt_t;
 typedef struct {
@@ -158,7 +159,7 @@ struct kr_request {
 	int has_tls;
 	knot_mm_t pool;
 };
-enum kr_rank {KR_RANK_INITIAL, KR_RANK_OMIT, KR_RANK_INDET, KR_RANK_BOGUS, KR_RANK_MISMATCH, KR_RANK_MISSING, KR_RANK_INSECURE = 8, KR_RANK_AUTH = 16, KR_RANK_SECURE = 32};
+enum kr_rank {KR_RANK_INITIAL, KR_RANK_OMIT, KR_RANK_TRY, KR_RANK_INDET = 4, KR_RANK_BOGUS, KR_RANK_MISMATCH, KR_RANK_MISSING, KR_RANK_INSECURE, KR_RANK_AUTH = 16, KR_RANK_SECURE = 32};
 struct knot_rrset {
 	knot_dname_t *_owner;
 	uint16_t type;
@@ -184,6 +185,7 @@ struct kr_query {
 	uint32_t secret;
 	uint16_t fails;
 	uint16_t reorder;
+	struct timeval creation_time;
 	struct timeval timestamp;
 	struct kr_zonecut zone_cut;
 	struct kr_nsrep ns;
diff --git a/daemon/main.c b/daemon/main.c
index f70c441f2202b14741f785156b438a829c113526..276f0fb7f40296f7e00c4c784edb754cf3630475 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -643,7 +643,7 @@ int main(int argc, char **argv)
 
 	/* Workaround for https://github.com/libuv/libuv/issues/45
 	 * (Write after ECONNRESET crash.) */
-	if (ret && signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+	if (ret == 0 && signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
 		kr_log_error("[system] can't block SIGPIPE signal: %s\n",
 				strerror(errno));
 		ret = EXIT_FAILURE;