Fix packet size configuration, add tests.