fix level generation crash; fix serialization crash