Change from `if not obj.flags...` to:

```
obj = np.ascontigousarray(obj)
```