Handle missing columns
Handle schema is None; fix logic.