Gold ends with small gain