Improved struct writing tests.