Fixed the tests

- The serialize-messages config defaults to 'on', which makes one of the tests
  fail.
- Refactored to make the test work