Updated metrics code.