Corrected an error in matrix_builder