Fix couple of seg faults migrating to soic enviornment