Fix tx file serialization and tests.