Gold settles at a three-week high