Ivanhoe swings to second-quarter profit