crude ends higher, gold declines