Fix wrong data format being dumped

c8af625aa4 introduced a regression, no failing tests were found.
Tests weren't catching the problem, so I also fixed the tests.