Fix saving calculated metrics. Fixes #17