gold ends slightly higher, as dollar falls