Bug fix in dc matrix generation