Fix metric loading into JS