Fixed the register matrix to be able to handle conditions when no registers are found.