diff --git a/game/modules/tome/data/general/npcs/faeros.lua b/game/modules/tome/data/general/npcs/faeros.lua
index a73d01604eb7462df13dd6629687b088e72f6ca6..4385b511768ab35c428ee616a237d8f9f6bfde8a 100644
--- a/game/modules/tome/data/general/npcs/faeros.lua
+++ b/game/modules/tome/data/general/npcs/faeros.lua
@@ -45,6 +45,10 @@ newEntity{
 	no_breath = 1,
 	poison_immune = 1,
 	disease_immune = 1,
+	stun_immune = 1,
+	blind_immune = 1,
+	knockback_immune = 1,
+	confusion_immune = 1,
 	on_die = function(self, who)
 		local part = "FAEROS_ASH"
 		if game.player:hasQuest("brotherhood-of-alchemists") then
diff --git a/game/modules/tome/data/general/npcs/gwelgoroth.lua b/game/modules/tome/data/general/npcs/gwelgoroth.lua
index 09f13ed931c0bd4fe301a949f1ee352c1d174c43..b95c675fac255d58eefdd96d11bdf47f0f6db9b8 100644
--- a/game/modules/tome/data/general/npcs/gwelgoroth.lua
+++ b/game/modules/tome/data/general/npcs/gwelgoroth.lua
@@ -45,6 +45,10 @@ newEntity{
 	no_breath = 1,
 	poison_immune = 1,
 	disease_immune = 1,
+	stun_immune = 1,
+	blind_immune = 1,
+	knockback_immune = 1,
+	confusion_immune = 1,
 }
 
 newEntity{ base = "BASE_NPC_GWELGOROTH",
diff --git a/game/modules/tome/data/general/npcs/losgoroth.lua b/game/modules/tome/data/general/npcs/losgoroth.lua
index b813d82d9f4b5e315b4a65e2fb806ca14b80d866..02d4d7fbdd792630f871e6d21d40276bb3adc34f 100644
--- a/game/modules/tome/data/general/npcs/losgoroth.lua
+++ b/game/modules/tome/data/general/npcs/losgoroth.lua
@@ -47,6 +47,10 @@ newEntity{
 	no_breath = 1,
 	poison_immune = 1,
 	disease_immune = 1,
+	stun_immune = 1,
+	blind_immune = 1,
+	knockback_immune = 1,
+	confusion_immune = 1,
 }
 
 newEntity{ base = "BASE_NPC_LOSGOROTH",
diff --git a/game/modules/tome/data/general/npcs/telugoroth.lua b/game/modules/tome/data/general/npcs/telugoroth.lua
index 43ff2e13087bd6e6413921b33ba1095099081484..8af421aa419cb0d62d4dd01674c1ebd174ba0b34 100644
--- a/game/modules/tome/data/general/npcs/telugoroth.lua
+++ b/game/modules/tome/data/general/npcs/telugoroth.lua
@@ -46,6 +46,10 @@ newEntity{
 	no_breath = 1,
 	poison_immune = 1,
 	disease_immune = 1,
+	stun_immune = 1,
+	blind_immune = 1,
+	knockback_immune = 1,
+	confusion_immune = 1,
 }
 
 newEntity{ base = "BASE_NPC_TELUGOROTH",
diff --git a/src/luajit2/src/buildvm_asm.c b/src/luajit2/src/buildvm_asm.c
index 49d6ffcaea7d338da71076db9b944e7c7c13fb4b..5cfa7ae81d1929998893cb7ba2cc1c9114f221bd 100644
--- a/src/luajit2/src/buildvm_asm.c
+++ b/src/luajit2/src/buildvm_asm.c
@@ -191,7 +191,8 @@ void emit_asm(BuildCtx *ctx)
   if (ctx->mode != BUILD_machasm)
     fprintf(ctx->fp, ".Lbegin:\n");
 
-#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__)
+#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__) && \
+    !LJ_TARGET_OSX
   /* This should really be moved into buildvm_arm.dasc. */
   fprintf(ctx->fp,
 	  ".fnstart\n"
@@ -227,7 +228,8 @@ void emit_asm(BuildCtx *ctx)
 #endif
   }
 
-#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__)
+#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__) && \
+    !LJ_TARGET_OSX
   fprintf(ctx->fp,
 	  ".globl lj_err_unwind_arm\n"
 	  ".personality lj_err_unwind_arm\n"
diff --git a/src/luajit2/src/lj_asm.c b/src/luajit2/src/lj_asm.c
index b3fa7739793f786f507fffb0da8043abab223575..adb5a9ceee0ffa3f0d035a5be539ef5a02c664a1 100644
--- a/src/luajit2/src/lj_asm.c
+++ b/src/luajit2/src/lj_asm.c
@@ -859,19 +859,23 @@ static uint32_t ir_khash(IRIns *ir)
   return hashrot(lo, hi);
 }
 
+#if !LJ_TARGET_X86ORX64 && LJ_TARGET_OSX
+void sys_icache_invalidate(void *start, size_t len);
+#endif
+
 /* Flush instruction cache. */
 static void asm_cache_flush(MCode *start, MCode *end)
 {
   VG_INVALIDATE(start, (char *)end-(char *)start);
 #if LJ_TARGET_X86ORX64
   UNUSED(start); UNUSED(end);
-#else
-#if defined(__GNUC__)
+#elif LJ_TARGET_OSX
+  sys_icache_invalidate(start, end-start);
+#elif defined(__GNUC__)
   __clear_cache(start, end);
 #else
 #error "Missing builtin to flush instruction cache"
 #endif
-#endif
 }
 
 /* -- Allocations --------------------------------------------------------- */
diff --git a/src/luajit2/src/lj_err.c b/src/luajit2/src/lj_err.c
index 42bb87fc66beee7c057a1db09b053e1d577d8637..35dfeabb8fc29595ba01c066552b902d9a7de357 100644
--- a/src/luajit2/src/lj_err.c
+++ b/src/luajit2/src/lj_err.c
@@ -178,7 +178,8 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode)
 
 /* -- External frame unwinding -------------------------------------------- */
 
-#if defined(__GNUC__) && !defined(__symbian__)
+#if defined(__GNUC__) && !defined(__symbian__) && \
+    !(LJ_TARGET_ARM && LJ_TARGET_OSX)
 
 #ifdef __clang__
 /* http://llvm.org/bugs/show_bug.cgi?id=8703 */
@@ -227,7 +228,9 @@ LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions,
     }
 #if LJ_UNWIND_EXT
     cf = err_unwind(L, cf, errcode);
-    if (cf) {
+    if ((actions & _UA_FORCE_UNWIND)) {
+      return _URC_CONTINUE_UNWIND;
+    } else if (cf) {
       _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode);
       _Unwind_SetIP(ctx, (_Unwind_Ptr)(cframe_unwind_ff(cf) ?
 				       lj_vm_unwind_ff_eh :
@@ -255,8 +258,12 @@ LJ_FUNCA int lj_err_unwind_dwarf(int version, _Unwind_Action actions,
 }
 
 #if LJ_UNWIND_EXT
-/* NYI: this is not thread-safe. */
+#if LJ_TARGET_OSX
+/* Sorry, no thread safety for OSX. Complain to Apple, not me. */
 static struct _Unwind_Exception static_uex;
+#else
+static __thread struct _Unwind_Exception static_uex;
+#endif
 
 /* Raise DWARF2 exception. */
 static void err_raise_ext(int errcode)
@@ -280,7 +287,7 @@ LJ_FUNCA _Unwind_Reason_Code lj_err_unwind_arm(_Unwind_State state,
     setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));
     return _URC_HANDLER_FOUND;
   }
-  if ((state & _US_ACTION_MASK) == _US_UNWIND_FRAME_STARTING) {
+  if ((state&(_US_ACTION_MASK|_US_FORCE_UNWIND)) == _US_UNWIND_FRAME_STARTING) {
     _Unwind_DeleteException(ucb);
     _Unwind_SetGR(ctx, 15, (_Unwind_Word)(void *)lj_err_throw);
     _Unwind_SetGR(ctx, 0, (_Unwind_Word)L);
diff --git a/src/luajit2/src/lj_ircall.h b/src/luajit2/src/lj_ircall.h
index 3b0a54b6f4c62068a7dcbd7093a9b8e4589ca0c1..a1f0b05298247791ec8f866638a01f9b2a9f830a 100644
--- a/src/luajit2/src/lj_ircall.h
+++ b/src/luajit2/src/lj_ircall.h
@@ -182,8 +182,6 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
 #define softfp_f2d __aeabi_f2d
 #define softfp_d2i __aeabi_d2iz
 #define softfp_d2ui __aeabi_d2uiz
-#define softfp_d2l __aeabi_d2lz
-#define softfp_d2ul __aeabi_d2ulz
 #define softfp_d2f __aeabi_d2f
 #define softfp_i2f __aeabi_i2f
 #define softfp_ui2f __aeabi_ui2f
@@ -191,8 +189,17 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
 #define softfp_ul2f __aeabi_ul2f
 #define softfp_f2i __aeabi_f2iz
 #define softfp_f2ui __aeabi_f2uiz
+#if LJ_TARGET_OSX
+#define softfp_d2l __fixdfdi
+#define softfp_d2ul __fixunsdfdi
+#define softfp_f2l __fixsfdi
+#define softfp_f2ul __fixunssfdi
+#else
+#define softfp_d2l __aeabi_d2lz
+#define softfp_d2ul __aeabi_d2ulz
 #define softfp_f2l __aeabi_f2lz
 #define softfp_f2ul __aeabi_f2ulz
+#endif
 #else
 #error "Missing soft-float definitions for target architecture"
 #endif
diff --git a/src/luajit2/src/lj_snap.c b/src/luajit2/src/lj_snap.c
index 9124b7896bbc4076665f09b7bc4509e5be72a47c..e29b535711d135c42fd9c87a7e88b8fcfe8206c0 100644
--- a/src/luajit2/src/lj_snap.c
+++ b/src/luajit2/src/lj_snap.c
@@ -192,7 +192,7 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf,
     handle_jump: {
       BCReg minslot = bc_a(ins);
       if (op >= BC_FORI && op <= BC_JFORL) minslot += FORL_EXT;
-      else if (op >= BC_ITERL && op <= BC_JITERL) minslot += bc_b(pc[-1])-1;
+      else if (op >= BC_ITERL && op <= BC_JITERL) minslot += bc_b(pc[-2])-1;
       else if (op == BC_UCLO) { pc += bc_j(ins); break; }
       for (s = minslot; s < maxslot; s++) DEF_SLOT(s);
       return minslot < maxslot ? minslot : maxslot;