fixed errors in metric testing code