Added appropriate matrix to data frame conversion.