Improved serialize testing