Fixed bug with specifying request format.

Updated tests.