Fixed temp_matrix_ bug