Cleanup closure serialization code