diff --git a/hdl/orbit_error.vhd b/hdl/orbit_error.vhd
index dccb51a08e487fab4be73851ba4101f477093e81..bd6f795287f1770273bf1ebd54617bd875d4d3fb 100644
--- a/hdl/orbit_error.vhd
+++ b/hdl/orbit_error.vhd
@@ -69,40 +69,40 @@ begin
     -- Port A is read write from AXI controller, Port B is read only from logic
     inst_refx_table: entity desy.ram_tdp
     generic map(
-        G_ADDR      => C_W_BPMID,
+        G_ADDR      => C_W_MM_IDCNT,
         G_DATA      => C_W_BPMPOS
     )
     port map(
         pi_clk_a    => clk,
         pi_en_a     => reforbitx_i.en,
         pi_we_a     => reforbitx_i.we,
-        pi_addr_a   => reforbitx_i.addr(C_W_BPMID-1 downto 0),
+        pi_addr_a   => reforbitx_i.addr(C_W_MM_IDCNT-1 downto 0),
         pi_data_a   => reforbitx_i.data,
         po_data_a   => reforbitx_o.data,
         pi_clk_b    => clk,
         pi_en_b     => '1',
         pi_we_b     => '0',
-        pi_addr_b   => bpm_id,
+        pi_addr_b   => bpm_id(C_W_MM_IDCNT-1 downto 0),
         pi_data_b   => (others => '0'),
         po_data_b   => table_refx
     );
 
     inst_refy_table: entity desy.ram_tdp
     generic map(
-        G_ADDR      => C_W_BPMID,
+        G_ADDR      => C_W_MM_IDCNT,
         G_DATA      => C_W_BPMPOS
     )
     port map(
         pi_clk_a    => clk,
         pi_en_a     => reforbity_i.en,
         pi_we_a     => reforbity_i.we,
-        pi_addr_a   => reforbity_i.addr(C_W_BPMID-1 downto 0),
+        pi_addr_a   => reforbity_i.addr(C_W_MM_IDCNT-1 downto 0),
         pi_data_a   => reforbity_i.data,
         po_data_a   => reforbity_o.data,
         pi_clk_b    => clk,
         pi_en_b     => '1',
         pi_we_b     => '0',
-        pi_addr_b   => bpm_id,
+        pi_addr_b   => bpm_id(C_W_MM_IDCNT-1 downto 0),
         pi_data_b   => (others => '0'),
         po_data_b   => table_refy
     );
diff --git a/rdl/corr_matrixpi.rdl b/rdl/corr_matrixpi.rdl
index 148e37757f369e3923fef2d82e731799cd7b436c..000e35169721c10d812483a792b9bb6b4ee04b0c 100644
--- a/rdl/corr_matrixpi.rdl
+++ b/rdl/corr_matrixpi.rdl
@@ -52,13 +52,13 @@ addrmap corr_matrixpi {
     mem {
         desc = "X Reference orbit.";
         memwidth = `C_W_BPMPOS;
-        mementries = 2**`C_W_BPMID;
+        mementries = 2**`C_W_MM_IDCNT;
     } external REFORBITX;
 
     mem {
         desc = "Y Reference orbit.";
         memwidth = `C_W_BPMPOS;
-        mementries = 2**`C_W_BPMID;
+        mementries = 2**`C_W_MM_IDCNT;
     } external REFORBITY;
 
     mem {