Add platform attribute to cartridge serialization and fixed tests