Corrected long value formatting and URI escaping.
Merged from master.