Fixes for serialize() integration