fix metric matrix in test function