US stocks open with gains, on recovery from previous losses