gold ends slightly higher on investment demand