Added some profiling to LUA error handler