Dollar erases gains after positive U.S. data amid profit-taking