Assessing the accuracy of metadynamics