Fixed exceptions not being thrown by writeVariable with Lua 5.2