Clean up metric names from misplaced dots when storing into cache

Fixes issue #181