Fixed bugs relating to string serialization