Fix tests for metric API