diff --git a/src/cooking.lua b/src/cooking.lua
index a14e30ec315f1b29b0886eb302ff8ef37aee489e..aaeae79c2fd6e73ef05079b1eea7d4f6af17c07f 100644
--- a/src/cooking.lua
+++ b/src/cooking.lua
@@ -88,7 +88,7 @@ end
 function cauldron.boiling_timer(pos)
 	local node = minetest.get_node(pos)
 	local objs = minetest.get_objects_inside_radius(pos, 0.5)
-	if objs == {} then return true end
+	if not next(objs) then return true end
 
 	local ingredients = {}
 	for _, obj in pairs(objs) do
diff --git a/src/mechanisms.lua b/src/mechanisms.lua
index 46863021f21ca59e39fed6256d9c45f3fbe6c108..5ca73a96e8c6759bcb15a94e7306464d35f9ec83 100644
--- a/src/mechanisms.lua
+++ b/src/mechanisms.lua
@@ -32,14 +32,14 @@ end
 
 function plate.timer(pos)
 	local objs = minetest.get_objects_inside_radius(pos, 0.8)
-	if objs == {} or not doors.get then return true end
+	if not next(objs) or not doors.get then return true end
 	local minp = {x=pos.x-2, y=pos.y, z=pos.z-2}
 	local maxp = {x=pos.x+2, y=pos.y, z=pos.z+2}
 	local doors = minetest.find_nodes_in_area(minp, maxp, "group:door")
 
 	for _, player in pairs(objs) do
 		if player:is_player() then
-			for i = 1, #doors do
+			for i=1, #doors do
 				door_toggle(pos, doors[i], player)
 			end
 			break
@@ -92,15 +92,13 @@ xdecor.register("lever_off", {
 	sounds = default.node_sound_stone_defaults(),
 	sunlight_propagates = true,
 	on_rotate = screwdriver.rotate_simple,
-	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-		if not doors.get then
-			return itemstack
-		end
+	on_rightclick = function(pos, node, clicker, itemstack)
+		if not doors.get then return itemstack end
 		local minp = {x=pos.x-2, y=pos.y-1, z=pos.z-2}
 		local maxp = {x=pos.x+2, y=pos.y+1, z=pos.z+2}
 		local doors = minetest.find_nodes_in_area(minp, maxp, "group:door")
 
-		for i = 1, #doors do
+		for i=1, #doors do
 			door_toggle(pos, doors[i], clicker)
 		end
 		return itemstack