Stocks open weakly but are still headed for a monthly gain