Added -uid, -token options, fixes
merge