diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp
index 682845135..dd75e03ed 100644
--- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp
+++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp
@@ -460,7 +460,6 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
 {
 
 	this->set_layer(first_layer_height, first_layer_height, tools.size(), true, false);
-	this->m_num_layer_changes 	= 0;
 	this->m_current_tool 		= tools.front();
     
     // The Prusa i3 MK2 has a working space of [0, -2.2] to [250, 210].
@@ -574,7 +573,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
 		.set_y_shift(m_y_shift + (tool!=(unsigned int)(-1) && (m_current_shape == SHAPE_REVERSED && !m_peters_wipe_tower) ? m_layer_info->depth - m_layer_info->toolchanges_depth(): 0.f))
 		.append(";--------------------\n"
 				"; CP TOOLCHANGE START\n")
-		.comment_with_value(" toolchange #", m_num_tool_changes)
+		.comment_with_value(" toolchange #", m_num_tool_changes + 1) // the number is zero-based
 		.comment_material(m_filpar[m_current_tool].material)
 		.append(";--------------------\n")
 		.speed_override(100);
@@ -975,8 +974,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
 		.set_y_shift(m_y_shift - (m_current_shape == SHAPE_REVERSED && !m_peters_wipe_tower ? m_layer_info->toolchanges_depth() : 0.f))
 		.append(";--------------------\n"
 				"; CP EMPTY GRID START\n")
-		// m_num_layer_changes is incremented by set_z, so it is 1 based.
-		.comment_with_value(" layer #", m_num_layer_changes - 1);
+		.comment_with_value(" layer #", m_num_layer_changes + 1);
 
 	// Slow down on the 1st layer.
 	float speed_factor = m_is_first_layer ? 0.5f : 1.f;
diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp
index 26c40fbc9..175de0276 100644
--- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp
+++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp
@@ -121,8 +121,12 @@ public:
 		m_print_brim = is_first_layer;
 		m_depth_traversed  = 0.f;
 		m_current_shape = (! is_first_layer && m_current_shape == SHAPE_NORMAL) ? SHAPE_REVERSED : SHAPE_NORMAL;
-		
-		++ m_num_layer_changes;
+		if (is_first_layer) {
+            this->m_num_layer_changes 	= 0;
+            this->m_num_tool_changes 	= 0;
+        }
+        else
+            ++ m_num_layer_changes;
 		
 		// Calculate extrusion flow from desired line width, nozzle diameter, filament diameter and layer_height:
 		m_extrusion_flow = extrusion_flow(layer_height);