Fixing SpaceType read/write bugs