Fixed bugs, improved inventory serialization