gold ends modestly higher on weaker dollar