More correct fields handling when building request, and more tests.