Fix nested tags serialization