Fix metric calculations