diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c
index a5d4af412634a4c1faf22480137312c69ae7df17..4e00345d207f4d46dfbcf14d3fa1bcda1a54c89d 100644
--- a/src/lua_hooklib.c
+++ b/src/lua_hooklib.c
@@ -265,7 +265,6 @@ boolean LUAh_MobjHook(mobj_t *mo, enum hook which)
 	I_Assert(mo->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -274,11 +273,11 @@ boolean LUAh_MobjHook(mobj_t *mo, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 1, 1)) {
+		if (lua_pcall(gL, 1, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -296,11 +295,11 @@ boolean LUAh_MobjHook(mobj_t *mo, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 1, 1)) {
+		if (lua_pcall(gL, 1, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -324,7 +323,6 @@ boolean LUAh_PlayerHook(player_t *plr, enum hook which)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = playerhooks; hookp; hookp = hookp->next)
 	{
@@ -332,11 +330,11 @@ boolean LUAh_PlayerHook(player_t *plr, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 			LUA_PushUserdata(gL, plr, META_PLAYER);
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 1, 1)) {
+		if (lua_pcall(gL, 1, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -360,7 +358,6 @@ void LUAh_MapChange(INT16 mapnumber)
 		return;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 	lua_pushinteger(gL, mapnumber);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
@@ -370,10 +367,7 @@ void LUAh_MapChange(INT16 mapnumber)
 
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 0, 1)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 1);
 	}
 
 	lua_settop(gL, 0);
@@ -387,7 +381,6 @@ void LUAh_MapLoad(void)
 		return;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 	lua_pushinteger(gL, gamemap);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
@@ -397,10 +390,7 @@ void LUAh_MapLoad(void)
 
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 0, 1)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 1);
 	}
 
 	lua_settop(gL, 0);
@@ -414,7 +404,6 @@ void LUAh_PlayerJoin(int playernum)
 		return;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 	lua_pushinteger(gL, playernum);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
@@ -424,10 +413,7 @@ void LUAh_PlayerJoin(int playernum)
 
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 0, 1)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 1);
 	}
 
 	lua_settop(gL, 0);
@@ -440,23 +426,19 @@ void LUAh_PreThinkFrame(void)
 	if (!gL || !(hooksAvailable[hook_PreThinkFrame/8] & (1<<(hook_PreThinkFrame%8))))
 		return;
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_PreThinkFrame)
 			continue;
 
 		PushHook(gL, hookp);
-		if (lua_pcall(gL, 0, 0, 1)) {
+		if (lua_pcall(gL, 0, 0, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
 			hookp->error = true;
 		}
 	}
-
-	lua_pop(gL, 1); // Pop error handler
 }
 
 // Hook for frame (after mobj and player thinkers)
@@ -469,8 +451,6 @@ void LUAh_ThinkFrame(void)
 	if (!gL || !(hooksAvailable[hook_ThinkFrame/8] & (1<<(hook_ThinkFrame%8))))
 		return;
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_ThinkFrame)
@@ -479,7 +459,7 @@ void LUAh_ThinkFrame(void)
 		if (cv_perfstats.value == 3)
 			time_taken = I_GetTimeMicros();
 		PushHook(gL, hookp);
-		if (lua_pcall(gL, 0, 0, 1)) {
+		if (lua_pcall(gL, 0, 0, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -496,10 +476,9 @@ void LUAh_ThinkFrame(void)
 			hook_index++;
 		}
 	}
-
-	lua_pop(gL, 1); // Pop error handler
 }
 
+
 // Hook for frame (at end of tick, ie after overlays, precipitation, specials)
 void LUAh_PostThinkFrame(void)
 {
@@ -507,23 +486,19 @@ void LUAh_PostThinkFrame(void)
 	if (!gL || !(hooksAvailable[hook_PostThinkFrame/8] & (1<<(hook_PostThinkFrame%8))))
 		return;
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_PostThinkFrame)
 			continue;
 
 		PushHook(gL, hookp);
-		if (lua_pcall(gL, 0, 0, 1)) {
+		if (lua_pcall(gL, 0, 0, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
 			hookp->error = true;
 		}
 	}
-
-	lua_pop(gL, 1); // Pop error handler
 }
 
 // Hook for mobj collisions
@@ -537,7 +512,6 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
 	I_Assert(thing1->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj collision hooks
 	for (hookp = mobjcollidehooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -546,7 +520,7 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, thing1, META_MOBJ);
 			LUA_PushUserdata(gL, thing2, META_MOBJ);
@@ -554,7 +528,7 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -577,7 +551,7 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, thing1, META_MOBJ);
 			LUA_PushUserdata(gL, thing2, META_MOBJ);
@@ -585,7 +559,7 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -616,7 +590,6 @@ UINT8 LUAh_MobjLineCollideHook(mobj_t *thing, line_t *line, enum hook which)
 	I_Assert(thing->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj collision hooks
 	for (hookp = mobjcollidehooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -625,7 +598,7 @@ UINT8 LUAh_MobjLineCollideHook(mobj_t *thing, line_t *line, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, thing, META_MOBJ);
 			LUA_PushUserdata(gL, line, META_LINE);
@@ -633,7 +606,7 @@ UINT8 LUAh_MobjLineCollideHook(mobj_t *thing, line_t *line, enum hook which)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -656,7 +629,7 @@ UINT8 LUAh_MobjLineCollideHook(mobj_t *thing, line_t *line, enum hook which)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, thing, META_MOBJ);
 			LUA_PushUserdata(gL, line, META_LINE);
@@ -664,7 +637,7 @@ UINT8 LUAh_MobjLineCollideHook(mobj_t *thing, line_t *line, enum hook which)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -696,17 +669,16 @@ boolean LUAh_MobjThinker(mobj_t *mo)
 	I_Assert(mo->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj thinker hooks
 	for (hookp = mobjthinkerhooks[MT_NULL]; hookp; hookp = hookp->next)
 	{
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 1, 1)) {
+		if (lua_pcall(gL, 1, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -721,11 +693,11 @@ boolean LUAh_MobjThinker(mobj_t *mo)
 	for (hookp = mobjthinkerhooks[mo->type]; hookp; hookp = hookp->next)
 	{
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2);
-		if (lua_pcall(gL, 1, 1, 1)) {
+		if (lua_pcall(gL, 1, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -752,7 +724,6 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
 	I_Assert(special->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic touch special hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -761,7 +732,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, special, META_MOBJ);
 			LUA_PushUserdata(gL, toucher, META_MOBJ);
@@ -769,7 +740,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -787,7 +758,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, special, META_MOBJ);
 			LUA_PushUserdata(gL, toucher, META_MOBJ);
@@ -795,7 +766,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -822,7 +793,6 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 	I_Assert(target->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic should damage hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -831,7 +801,7 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -845,7 +815,7 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
-		if (lua_pcall(gL, 5, 1, 1)) {
+		if (lua_pcall(gL, 5, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -866,8 +836,9 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 	{
 		if (hookp->type != hook_ShouldDamage)
 			continue;
+
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -881,7 +852,7 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
-		if (lua_pcall(gL, 5, 1, 1)) {
+		if (lua_pcall(gL, 5, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -913,7 +884,6 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 	I_Assert(target->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj damage hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -922,7 +892,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -936,7 +906,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
-		if (lua_pcall(gL, 5, 1, 1)) {
+		if (lua_pcall(gL, 5, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -954,7 +924,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -968,7 +938,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
-		if (lua_pcall(gL, 5, 1, 1)) {
+		if (lua_pcall(gL, 5, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -995,7 +965,6 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
 	I_Assert(target->type < NUMMOBJTYPES);
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj death hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -1004,7 +973,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -1016,7 +985,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
-		if (lua_pcall(gL, 4, 1, 1)) {
+		if (lua_pcall(gL, 4, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1034,7 +1003,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, target, META_MOBJ);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -1046,7 +1015,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
-		if (lua_pcall(gL, 4, 1, 1)) {
+		if (lua_pcall(gL, 4, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1071,14 +1040,13 @@ boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_BotTiccmd)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, bot, META_PLAYER);
 			LUA_PushUserdata(gL, cmd, META_TICCMD);
@@ -1086,7 +1054,7 @@ boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1111,7 +1079,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
@@ -1119,7 +1086,7 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
 		|| (hookp->s.str && strcmp(hookp->s.str, ((skin_t*)tails->skin)->name)))
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, sonic, META_MOBJ);
 			LUA_PushUserdata(gL, tails, META_MOBJ);
@@ -1127,7 +1094,7 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 8, 1)) {
+		if (lua_pcall(gL, 2, 8, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1174,14 +1141,13 @@ boolean LUAh_BotRespawn(mobj_t *sonic, mobj_t *tails)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_BotRespawn)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, sonic, META_MOBJ);
 			LUA_PushUserdata(gL, tails, META_MOBJ);
@@ -1189,7 +1155,7 @@ boolean LUAh_BotRespawn(mobj_t *sonic, mobj_t *tails)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1219,7 +1185,6 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
 		return 0;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = linedefexecutorhooks; hookp; hookp = hookp->next)
 	{
@@ -1227,7 +1192,7 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, line, META_LINE);
 			LUA_PushUserdata(gL, mo, META_MOBJ);
@@ -1237,10 +1202,7 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
 		lua_pushvalue(gL, -4);
 		lua_pushvalue(gL, -4);
 		lua_pushvalue(gL, -4);
-		if (lua_pcall(gL, 3, 0, 1)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 3);
 		hooked = true;
 	}
 
@@ -1257,14 +1219,13 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_PlayerMsg)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, &players[source], META_PLAYER); // Source player
 			if (flags & 2 /*HU_CSAY*/) { // csay TODO: make HU_CSAY accessible outside hu_stuff.c
@@ -1287,7 +1248,7 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
-		if (lua_pcall(gL, 4, 1, 1)) {
+		if (lua_pcall(gL, 4, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1313,7 +1274,6 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
@@ -1321,7 +1281,7 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
 		|| (hookp->s.mt && !(inflictor && hookp->s.mt == inflictor->type)))
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, inflictor, META_MOBJ);
@@ -1333,7 +1293,7 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
 		lua_pushvalue(gL, -5);
-		if (lua_pcall(gL, 4, 1, 1)) {
+		if (lua_pcall(gL, 4, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1352,7 +1312,7 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
 void LUAh_NetArchiveHook(lua_CFunction archFunc)
 {
 	hook_p hookp;
-	int errorhandlerindex;
+
 	if (!gL || !(hooksAvailable[hook_NetVars/8] & (1<<(hook_NetVars%8))))
 		return;
 
@@ -1360,11 +1320,8 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc)
 	I_Assert(lua_gettop(gL) > 0);
 	I_Assert(lua_istable(gL, -1));
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-	errorhandlerindex = lua_gettop(gL);
-
 	// tables becomes an upvalue of archFunc
-	lua_pushvalue(gL, -2);
+	lua_pushvalue(gL, -1);
 	lua_pushcclosure(gL, archFunc, 1);
 	// stack: tables, archFunc
 
@@ -1375,13 +1332,10 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc)
 
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -2); // archFunc
-		if (lua_pcall(gL, 1, 0, errorhandlerindex)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 1);
 	}
 
-	lua_pop(gL, 2); // Pop archFunc and error handler
+	lua_pop(gL, 1); // pop archFunc
 	// stack: tables
 }
 
@@ -1393,7 +1347,6 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj map thing spawn hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -1402,7 +1355,7 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 			LUA_PushUserdata(gL, mthing, META_MAPTHING);
@@ -1410,7 +1363,7 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1428,7 +1381,7 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, mo, META_MOBJ);
 			LUA_PushUserdata(gL, mthing, META_MAPTHING);
@@ -1436,7 +1389,7 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1461,7 +1414,6 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
 		return 0;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	// Look for all generic mobj follow item hooks
 	for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
@@ -1470,7 +1422,7 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, mobj, META_MOBJ);
@@ -1478,7 +1430,7 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1496,7 +1448,7 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, mobj, META_MOBJ);
@@ -1504,7 +1456,7 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1529,7 +1481,6 @@ UINT8 LUAh_PlayerCanDamage(player_t *player, mobj_t *mobj)
 		return 0;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = playerhooks; hookp; hookp = hookp->next)
 	{
@@ -1537,7 +1488,7 @@ UINT8 LUAh_PlayerCanDamage(player_t *player, mobj_t *mobj)
 			continue;
 
 		ps_lua_mobjhooks++;
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, mobj, META_MOBJ);
@@ -1545,7 +1496,7 @@ UINT8 LUAh_PlayerCanDamage(player_t *player, mobj_t *mobj)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1573,14 +1524,13 @@ void LUAh_PlayerQuit(player_t *plr, kickreason_t reason)
 		return;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_PlayerQuit)
 			continue;
 
-	    if (lua_gettop(gL) == 1)
+	    if (lua_gettop(gL) == 0)
 	    {
 	        LUA_PushUserdata(gL, plr, META_PLAYER); // Player that quit
 	        lua_pushinteger(gL, reason); // Reason for quitting
@@ -1588,10 +1538,7 @@ void LUAh_PlayerQuit(player_t *plr, kickreason_t reason)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 0, 1)) {
-			CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
-			lua_pop(gL, 1);
-		}
+		LUA_Call(gL, 2);
 	}
 
 	lua_settop(gL, 0);
@@ -1604,23 +1551,19 @@ void LUAh_IntermissionThinker(void)
 	if (!gL || !(hooksAvailable[hook_IntermissionThinker/8] & (1<<(hook_IntermissionThinker%8))))
 		return;
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_IntermissionThinker)
 			continue;
 
 		PushHook(gL, hookp);
-		if (lua_pcall(gL, 0, 0, 1)) {
+		if (lua_pcall(gL, 0, 0, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
 			hookp->error = true;
 		}
 	}
-
-	lua_pop(gL, 1); // Pop error handler
 }
 
 // Hook for team switching
@@ -1633,14 +1576,13 @@ boolean LUAh_TeamSwitch(player_t *player, int newteam, boolean fromspectators, b
 		return true;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	for (hookp = playerhooks; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_TeamSwitch)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			lua_pushinteger(gL, newteam);
@@ -1654,7 +1596,7 @@ boolean LUAh_TeamSwitch(player_t *player, int newteam, boolean fromspectators, b
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
 		lua_pushvalue(gL, -6);
-		if (lua_pcall(gL, 5, 1, 1)) {
+		if (lua_pcall(gL, 5, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1679,8 +1621,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
 		return 0;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	hud_running = true; // local hook
 
 	for (hookp = playerhooks; hookp; hookp = hookp->next)
@@ -1688,7 +1628,7 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
 		if (hookp->type != hook_ViewpointSwitch)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, newdisplayplayer, META_PLAYER);
@@ -1698,7 +1638,7 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
 		lua_pushvalue(gL, -4);
 		lua_pushvalue(gL, -4);
 		lua_pushvalue(gL, -4);
-		if (lua_pcall(gL, 3, 1, 1)) {
+		if (lua_pcall(gL, 3, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1716,7 +1656,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
 	}
 
 	lua_settop(gL, 0);
-
 	hud_running = false;
 
 	return canSwitchView;
@@ -1732,8 +1671,6 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
 		return true;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	hud_running = true; // local hook
 
 	for (hookp = playerhooks; hookp; hookp = hookp->next)
@@ -1741,7 +1678,7 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
 		if (hookp->type != hook_SeenPlayer)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, seenfriend, META_PLAYER);
@@ -1749,7 +1686,7 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1762,7 +1699,6 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
 	}
 
 	lua_settop(gL, 0);
-
 	hud_running = false;
 
 	return hasSeenPlayer;
@@ -1777,8 +1713,6 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
 		return true;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	hud_running = true; // local hook
 
 	for (hookp = roothook; hookp; hookp = hookp->next)
@@ -1787,7 +1721,7 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
 			|| (hookp->s.str && strcmp(hookp->s.str, musname)))
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			lua_pushstring(gL, musname);
@@ -1795,7 +1729,7 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
@@ -1808,7 +1742,6 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
 	}
 
 	lua_settop(gL, 0);
-
 	hud_running = false;
 
 	return keepplaying;
@@ -1821,8 +1754,6 @@ void LUAh_GameQuit(void)
 	if (!gL || !(hooksAvailable[hook_GameQuit/8] & (1<<(hook_GameQuit%8))))
 		return;
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-
 	for (hookp = roothook; hookp; hookp = hookp->next)
 	{
 		if (hookp->type != hook_GameQuit)
@@ -1836,8 +1767,6 @@ void LUAh_GameQuit(void)
 			hookp->error = true;
 		}
 	}
-
-	lua_pop(gL, 1); // Pop error handler
 }
 
 // Hook for building player's ticcmd struct (Ported from SRB2Kart)
@@ -1850,7 +1779,6 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd)
 		return false;
 
 	lua_settop(gL, 0);
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
 
 	hook_cmd_running = true;
 	for (hookp = roothook; hookp; hookp = hookp->next)
@@ -1858,7 +1786,7 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd)
 		if (hookp->type != hook_PlayerCmd)
 			continue;
 
-		if (lua_gettop(gL) == 1)
+		if (lua_gettop(gL) == 0)
 		{
 			LUA_PushUserdata(gL, player, META_PLAYER);
 			LUA_PushUserdata(gL, cmd, META_TICCMD);
@@ -1866,7 +1794,7 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd)
 		PushHook(gL, hookp);
 		lua_pushvalue(gL, -3);
 		lua_pushvalue(gL, -3);
-		if (lua_pcall(gL, 2, 1, 1)) {
+		if (lua_pcall(gL, 2, 1, 0)) {
 			if (!hookp->error || cv_debug & DBG_LUA)
 				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
 			lua_pop(gL, 1);
diff --git a/src/lua_script.c b/src/lua_script.c
index ae7f479f6da07931dd68215c23bf272dfc6a2261..9aba84529a743b55ad5df81e35981e47b3fede3a 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -80,58 +80,6 @@ FUNCNORETURN static int LUA_Panic(lua_State *L)
 #endif
 }
 
-#define LEVELS1 12 // size of the first part of the stack
-#define LEVELS2 10 // size of the second part of the stack
-
-// Error handler used with pcall() when loading scripts or calling hooks
-// Takes a string with the original error message,
-// appends the traceback to it, and return the result
-int LUA_GetErrorMessage(lua_State *L)
-{
-	int level = 1;
-	int firstpart = 1; // still before eventual `...'
-	lua_Debug ar;
-
-	lua_pushliteral(L, "\nstack traceback:");
-	while (lua_getstack(L, level++, &ar))
-	{
-		if (level > LEVELS1 && firstpart)
-		{
-			// no more than `LEVELS2' more levels?
-			if (!lua_getstack(L, level + LEVELS2, &ar))
-				level--; // keep going
-			else
-			{
-				lua_pushliteral(L, "\n    ..."); // too many levels
-				while (lua_getstack(L, level + LEVELS2, &ar)) // find last levels
-					level++;
-			}
-			firstpart = 0;
-			continue;
-		}
-		lua_pushliteral(L, "\n    ");
-		lua_getinfo(L, "Snl", &ar);
-		lua_pushfstring(L, "%s:", ar.short_src);
-		if (ar.currentline > 0)
-			lua_pushfstring(L, "%d:", ar.currentline);
-		if (*ar.namewhat != '\0') // is there a name?
-			lua_pushfstring(L, " in function " LUA_QS, ar.name);
-		else
-		{
-			if (*ar.what == 'm') // main?
-				lua_pushfstring(L, " in main chunk");
-			else if (*ar.what == 'C' || *ar.what == 't')
-				lua_pushliteral(L, " ?"); // C function or tail call
-			else
-				lua_pushfstring(L, " in function <%s:%d>",
-					ar.short_src, ar.linedefined);
-		}
-		lua_concat(L, lua_gettop(L));
-	}
-	lua_concat(L, lua_gettop(L));
-	return 1;
-}
-
 // Moved here from lib_getenum.
 int LUA_PushGlobals(lua_State *L, const char *word)
 {
@@ -475,8 +423,6 @@ INT32 lua_lumploading = 0;
 // Load a script from a MYFILE
 static inline void LUA_LoadFile(MYFILE *f, char *name, boolean noresults)
 {
-	int errorhandlerindex;
-
 	if (!name)
 		name = wadfiles[f->wad]->filename;
 	CONS_Printf("Loading Lua script from %s\n", name);
@@ -487,14 +433,11 @@ static inline void LUA_LoadFile(MYFILE *f, char *name, boolean noresults)
 
 	lua_lumploading++; // turn on loading flag
 
-	lua_pushcfunction(gL, LUA_GetErrorMessage);
-	errorhandlerindex = lua_gettop(gL);
-	if (luaL_loadbuffer(gL, f->data, f->size, va("@%s",name)) || lua_pcall(gL, 0, noresults ? 0 : LUA_MULTRET, lua_gettop(gL) - 1)) {
+	if (luaL_loadbuffer(gL, f->data, f->size, va("@%s",name)) || lua_pcall(gL, 0, noresults ? 0 : LUA_MULTRET, 0)) {
 		CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL,-1));
 		lua_pop(gL,1);
 	}
 	lua_gc(gL, LUA_GCCOLLECT, 0);
-	lua_remove(gL, errorhandlerindex);
 
 	lua_lumploading--; // turn off again
 }
diff --git a/src/lua_script.h b/src/lua_script.h
index 5a3520d11996db85806704f6e88be1d9f8a16f6c..6815434c574198befebf67387bfbfa4ce25bf5cf 100644
--- a/src/lua_script.h
+++ b/src/lua_script.h
@@ -39,7 +39,6 @@ void LUA_ClearExtVars(void);
 
 extern INT32 lua_lumploading; // is LUA_LoadLump being called?
 
-int LUA_GetErrorMessage(lua_State *L);
 void LUA_LoadLump(UINT16 wad, UINT16 lump, boolean noresults);
 #ifdef LUA_ALLOW_BYTECODE
 void LUA_DumpFile(const char *filename);